#include "Log.hpp"
#include "UDP_Server.hpp"
#include <memory>

// 服务端main逻辑，开启服务：接受并显示客户端发送的信息，最终把信息发回客户端
//  ./udpserver localip localport
int main(int args, char *argv[])
{
    // 对传入参数个数进行讨论
    if (args != 2)
    {
        std::cerr << "Usage: " << argv[0] << " port" << std::endl;
        exit(0);
    }

    uint16_t port = std::stoi(argv[1]);

    ENABLE_SCREEN();
    std::unique_ptr<UdpServer> upt = std::make_unique<UdpServer>(port);
    upt->Init();
    upt->Start();

    return 0;
}